package com.start.dataSource.service;

import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.start.dataSource.entity.StartSourceDataTable;

public interface StartDataTableService {

    Page<StartSourceDataTable> pageSystemTable(Page page, Wrapper<StartSourceDataTable> wrapper, String dataSourcesKey);

    void updateById(StartSourceDataTable entity);

    StartSourceDataTable getTableById(String id, boolean isLoadOption);

    /**
     * 根据数据源数据表名 查询表配置
     *
     * @param dataSourceKeyFlag
     * @param tableName
     * @param isLoadOption
     * @return
     */
    StartSourceDataTable getTableByTableName(String dataSourceKeyFlag, String tableName, boolean isLoadOption);

    /**
     * 检查数据库中是否存在指定数据表
     *
     * @param dataSourceKeyFlag
     * @param tableName
     * @return
     */
    boolean dbHasTable(String dataSourceKeyFlag, String tableName);

    void removeTableById(String id);

    void save(StartSourceDataTable entity);

    void synchronizationTable(String dataSourcesKey, String tableName);

    boolean hasDataSource(String dataSourcesKey);


    void createTable(StartSourceDataTable entity);

    JSONObject getDesignConfig(String dataSourcesKey, String tableName);
}
